/**
 * 获取起草文稿-》材料征集详情mixins
 */
import {getCollectionFileList} from "@/api/subject";
import {getfileinfopage} from "@/api/system"
import {getNotNull,dealStartEndDate} from '@/views/util'
import {REVIEW_DIC} from '@/const/dict'
export default function () {
  return {
    data() {
      return {
        fileDetailData:[]
      }
    },
    methods: {
      getDetailData_file(id,type) {
        getCollectionFileList({
          relateId:id,
          type:type
        }).then(async response => {
          var records = response.data.data.records[0]
          let fileMap = {
            fileId:records.fileId,
            fileName:records.fileFullName
          }
          let fileList = []
          fileList.push(fileMap)
          this.fileDetailData = [
            {label: '文件名称', value: getNotNull(records.fileName)},
            {label: '文件类型', value: getNotNull(records.extend)},
            {label: '文件大小', value: getNotNull(records.size)},
            {label: '版本更新说明', value: getNotNull(records.updateReason)},
            {label: '文件版本', value: getNotNull(records.version)},
            {label: '上传时间', value: getNotNull(records.uploadTime)},
            {label: '上传人', value: getNotNull(records.uploadUsername)},
            {label: '附件', files:fileList},
          ]
        })
      }
    }
  }
}
